<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title>CCHVC首页</title>
<link href="${TEMPLATE_BASE_PATH}/css/bootstrap.min.css" rel="stylesheet">
<link href="${TEMPLATE_BASE_PATH}/css/base.css" rel="stylesheet">
<link href="${TEMPLATE_BASE_PATH}/css/style.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="${TEMPLATE_BASE_PATH}/js/html5shiv.min.js"></script>
<script src="${TEMPLATE_BASE_PATH}/js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript" src="${BASE_PATH}/static/business/js/time.js"></script>
<script>
window.onload=function(){
	$("title").html("CCHVC首页");
}
</script>
</head>
<body>

<div class="wrap">
    <div class="container pad0">
        <div class="row header">
            <!--左侧开始-->
            <div class="col-xs-4 col-sm-5 col-md-4">
            	<a href="${BASE_PATH}/web/toShowIndex.do">
                	<img src="${BASE_PATH}/static/business/images/logo.png">
                </a>
            </div>
            <!--右侧开始-->
            <div class="col-xs-7 col-sm-6 col-md-8 tip">
                <span>欢迎登录CCHVC服务平台</span>
                <a href="${BASE_PATH}/user/reg.htm">注册</a>
            </div>
        </div>
        <div class="row content">
            <!--左侧开始-->
            <div class="col-sm-6 col-md-7 c-left">
                <div class="pt190">
                	<a href="${BASE_PATH}/web/toShowIndex.do">
                    	<img src="${BASE_PATH}/static/business/images/logo-bg.png"><br/>
                    </a>
                    <a href="${BASE_PATH}/user/reg.htm" class="re-btn mt50">新用户请点此处进行注册 >></a>
                </div>               
            </div>
            <!--右侧开始-->
            <div class="col-xs-12 col-sm-5 col-md-4 c-right">
                <div class="box">
                    <div class="login-box">
                        <div class="login-title text-center">
                            <h1>欢迎登录CCHVC服务平台</h1>
                        </div>
                        <div class="login-content">
                            <div class="form">
                                <form action="#" method="post">
                                    <div class="form-group">
                                        <div class="col-xs-12 ">
                                            <div class="input-group">
                                                <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
                                                <input type="text" id="account" name="account" value="" class="form-control" placeholder="请输入账号">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-xs-12  ">
                                            <div class="input-group">
                                                <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
                                                <input type="password" id="password" name="password" value="" class="form-control" placeholder="请输入密码">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-xs-6 link">
                                            <p class=" remove-margin checkbox text-left">
                                                <!--<label><input type="checkbox" value="" checked>下次自动登录</label>-->
                                            </p>
                                        </div>
                                         <div class="col-xs-5 link">
                                            <p class="text-right remove-margin"><a href="###" data-toggle="modal" data-target="#modal-1" data-backdrop="static" >忘记密码</a>
                                            </p>
                                        </div>
                                    </div>
                                     <div class="form-group">
                                        <div class="text-center">
                                            <input type="button" value="登录" onclick="tijiaoform('account','password')" class="btn btn-s  btn-sr">
                                        </div>
                                    </div>               
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>  
    </div>   
</div>
<script type="text/javascript">
		function tijiaoform(account,password) {

		   var account=document.getElementById(account).value;
	   	   var password=document.getElementById(password).value;
	/*
	       if(account=='') {
			      document.getElementById(accountTip).innerHTML ='请输入常用的手机号码';
			      $('#'+accountTip).show();
	              return false;
	       }
	
	       if(password==''){
					$('#'+pdm).show();
					document.getElementById(pdm).innerHTML ='';
	                return false;
	       }

	       $('.tip-top').removeClass('hidden');
*/	
			$.ajax({
	            cache: true,
	            type: "POST",
	            url:"${BASE_PATH}/user/login.json",
	            dataType : 'json',
	            data:{account:account,password:password},
	            async: false,
	            success: function(data){
	               if(!data.result){
	               	for(var one in data.errors)
	               	alert(data.errors[one]);
	               }
	               else
	                {
	               		self.location = '${BASE_PATH}/web/productinfo/productShow.do';
	               	}
	            }
	        });
		
		}
</script>
<!-- footer开始 -->
<div class="footer">
    <p>北京网视通联科技股份有限公司</p>
    <p>地址：北京市海淀区知春路京仪孵化器D座3层</p>
    <p>Copyright © 2004-2014 CCHVC云通-CDN全业务平台版权所有</p>
    <p>京ICP备14002150号-1 京公网安备1101080213237号</p>
</div>

<!-- 弹出层 -->
<!-- 忘记密码开始-->
<div class="modal fade" id="modal-1">
    <div class="modal-dialog">
        <div class="modal-content">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">×</a>   
               <h4><span>忘记密码</span></h4>
           </div>
           <div class="modal-body text-center modal-pad">
               <a href="###" class="icon i-phone" data-toggle="modal" data-target="#modal-2" data-backdrop="static" data-dismiss="modal"><span>手机找回</span></a>
               <a href="###" class="icon i-mail" data-toggle="modal" data-target="#modal-4" data-backdrop="static" data-dismiss="modal"><span>邮箱找回</span></a>
           </div>
        </div>
    </div>
</div>
<!-- 手机找回 -->
<div class="modal fade" id="modal-2">
    <div class="modal-dialog modal-356">
        <div class="modal-content">
           <div class="modal-header">
               <a class="close" href="javascript:cancle('modal-2')">×</a>   
               <h4><span>手机找回</span></h4>
           </div>
           <div class="modal-body text-center">
                <form action="#" method="post">
                    <div class="form-group">
                        <div class="col-xs-12  ">
                            <div class="input-group">
                                <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
                                <input type="text" name="find_account" id="find_account" class="form-control" placeholder="请输入账号">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-xs-12  ">
                            <div class="input-group">
                                <span class="input-group-addon"><span class="glyphicon glyphicon-edit"></span></span>
                                <input type="text" name="yzm" id="yzm" class="form-control input-160" placeholder="请输入验证码">
                                <a href="javascript:get_yzm();" class="btn btn-y ml10 code" id="getVerify">获取验证码</a>
                                <a href="###" class="btn btn-c ml10 code-1 d-none" id="reGetVerify">重新发送</a>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-xs-12  ">
                            <div class="input-group">
                                <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
                                <input type="password" name="find_password" id="find_password" class="form-control" placeholder="请输入密码">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-xs-12  ">
                            <div class="input-group">
                                <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
                                <input type="password" name="find_passwordConfirm" id="find_passwordConfirm"  class="form-control" placeholder="请再次输入密码">
                            </div>
                        </div>
                    </div>
                     <div class="form-group">
                        <div class="text-center">
                            <button type="button" class="btn btn-s btn-40"  onclick="tj_resetmm()">重置密码</button>
                            <button type="button" class="btn btn-s btn-40 ml4" onclick="cancle('modal-2')">取消</button>
                        </div>
                    </div>               
                </form>
           </div>
        </div>
    </div>
</div>
<!-- 手机找回成功 -->
<div class="modal fade" id="modal-3">
    <div class="modal-dialog modal-400">
        <div class="modal-content">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">×</a>   
           </div>
           <div class="modal-body text-center">
                <span class="glyphicon glyphicon-ok ok"></span><br/>
                <p class="h4 mt20">登录密码修改成功</p>
           </div>
        </div>
    </div>
</div>
<!-- 邮箱找回 -->
<div class="modal fade" id="modal-4">
    <div class="modal-dialog modal-516">
        <div class="modal-content">
           <div class="modal-header">
               <a class="close" href="javascript:cancle('modal-4')">×</a>   
               <h4><span>邮箱找回</span></h4>
           </div>
           <div class="modal-body text-center">
                <form action="#" method="post">
                    <p class="tips f13">输入绑定邮箱，发送验证邮件，您的绑定邮箱会接收到一封验证邮件，请在
24小时之内打开邮件内的验证链接完成支付密码修改业务。</p>
                    <div class="form-group mb30">
                        <div class="col-xs-12 fn">
                           <div class="input-group">
                              <span class="input-group-addon input-left">注册手机账号：</span>
                                <input type="text" name="find_account_mail" id="find_account_mail" class="form-control input-220">
                            </div>
                         
                            <div class="input-group">
                              <span class="input-group-addon input-left">账号绑定邮箱：</span>
                                <input type="text" name="mail_addr" id="mail_addr" class="form-control input-220">
                            </div>
                        </div>
                    </div>
                     <div class="form-group">
                        <div class="text-center">
                            <!--<button type="button" class="btn btn-s btn-120" data-toggle="modal" data-target="#modal-5" data-dismiss="modal" data-backdrop="static">发送验证邮件</button>-->
                             <button type="button" class="btn btn-s btn-120 btn-mail" onclick="mailsendyzm()">发送验证邮件</button>
                             <button type="button" class="btn btn-s btn-120 ml80" onclick="cancle('modal-4')">取消</button>
                        </div>
                    </div>               
                </form>
           </div>
        </div>
    </div>
</div>
<!-- 验证邮件成功 -->
<div class="modal fade" id="modal-5">
    <div class="modal-dialog modal-400">
        <div class="modal-content">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">×</a>   
           </div>
           <div class="modal-body text-center">
                <span class="glyphicon glyphicon-ok ok"></span><br/>
                <p class="h4 mt20">验证邮件发送成功</p>
                <p class="f14 col9">请您于24小时内完成验证</p>
           </div>
        </div>
    </div>
</div>
<!-- 验证邮件失败 -->
<div class="modal fade" id="modal-6">
    <div class="modal-dialog modal-400">
        <div class="modal-content">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">×</a>   
           </div>
           <div class="modal-body text-center">
                <span class="glyphicon glyphicon-remove remove"></span><br/>
                <p class="h4 mt20">验证邮件发送失败</p>
                <p class="f14 col9">请重新验证</p>
           </div>
        </div>
    </div>
</div>
<script type="text/javascript">
		 /*验证码  by liaoliyun */
	function get_yzm(){
	
	    var account=document.getElementById("find_account").value;
	    //验证手机号
			var array=[[/^[1-9][\d]{10}?$/,account,"手机号不正确，请输入11位手机号"]];
			for(var	 i=0;i<array.length	;i++)
			{
				if(array[i][0].test(array[i][1])==false)
				{
					$("#getVerify").removeAttr("style");
		    		$("#reGetVerify").attr("style","display:none");
					alertMsgError("手机发送验证码失败",array[i][2]);
					return;
				}
			}
		    if(''==account){
		    	$("#getVerify").removeAttr("style");
		    	$("#reGetVerify").attr("style","display:none");
		    	alertMsgError("手机发送验证码失败","请先输入手机号码,在发送验证码");
		    	return;
		    }
	    		$.ajax({
	            cache: true,
	            type: "POST",
	            url:"${BASE_PATH}/user/send_yzm.json",
	            dataType : 'json',
	            data:{account:account},
	            async: false,
	            success: function(data){
	               if(!data.result){
	               	for(var one in data.errors)
	               	time('getVerify','reGetVerify');
	               	alertMsgError("手机发送验证码失败",data.errors[one]);
	               }
	               else{
	               	 time('getVerify','reGetVerify');
	                 alertMsgSuccess("手机发送验证码成功","发送验证码成功");
	               }
	            }
	        });
	  
     }
     function tj_resetmm(){
     	var useid = $('#find_account').val();
     	var yzm  = $('#yzm').val();
     	var srxmm = $('#find_password').val();
     	var qrxmm = $('#find_passwordConfirm').val();
		$.ajax({
	            cache: true,
	            type: "POST",
	            url:"${BASE_PATH}/user/resetmm.json",
	            dataType : 'json',
	            data:{useId:useid,Yzm:yzm,newmm:srxmm,qrnewmm:qrxmm},
	            async: false,
	            success: function(data){
	               if(data.result)
	               {
						alert("重置密码成功！");
						cancle("modal-2");
                   }
	               else
	               {
	               	  for(var one in data.errors)
	                  alert(data.errors[one]);	
	               }
	           }
	        });
	
     } 
     
     //取消
	function cancle(modal){
		$("#"+modal+"").modal('hide');
		eachInputEmpty(modal);
	}
	
     function mailsendyzm()
     {
        var account = $("#find_account_mail").val();
        var mailaddr=$("#mail_addr").val();
//    	alert("${BASE_PATH}/user/resetmm.json");
		$.ajax({
	            cache: true,
	            type: "POST",
	            url:"${BASE_PATH}/user/sendmailtofindmm.json",
	            dataType : 'json',
	            data:{account:account,mailaddr:mailaddr},
	            async: false,
	            success: function(data){
	               if(data.result)
	               {
	                    alertMsgSuccess("验证邮件发送成功","验证邮件发送成功，请于24小时内登录邮箱操作找回密码，否则验证失效，谢谢！");
						cancle("modal-4");
                   }
	               else
	               {
	                  //alert("send mail failed");
	               	  for(var one in data.errors)
	                  alertMsgError("验证邮件发送失败",data.errors[one]);	
	               }
	           }
	        });
     	
     }
     //失败-错误,弹窗
	function alertMsgError(title,msg){
		$('#modal-6 p').each(function(index){
			if(index==0){
				$(this).html("<font>"+title+"</font>");
			}else{
				$(this).html("<font color=red>"+msg+"</font>");
			}
		})
		$('#modal-6').modal('show');
	}
	//成功弹窗
	function alertMsgSuccess(title,msg){
		$('#modal-5 p').each(function(index){
			if(index==0){
				$(this).html("<font>"+title+"</font>");
			}else{
				$(this).html("<font>"+msg+"</font>");
			}
		})
		$('#modal-5').modal('show');
	}
	//清空input
	function eachInputEmpty(id){
		$("#"+id+" input").each(function(){
			$(this).val("");
		})
	}
</script>
<script src="${TEMPLATE_BASE_PATH}/js/jquery.js"></script>
<script src="${TEMPLATE_BASE_PATH}/js/bootstrap.min.js"></script>
<script src="${TEMPLATE_BASE_PATH}/js/public.js"></script>
</body>
</html>